<?
	require_once("class.paymentprocessor.php");
	class TwoCheckout extends PaymentProcessor
	{
		var $merchant_id;
		var $hash;
		
		//
		// Constructor
		//
		function TwoCheckout($merchant_id, $hash)
		{
			$this->merchant_id = $merchant_id;
			$this->hash = $hash;
		}
		
		
		function ProccessSinglePayment()
		{
			$retval = strtoupper( md5($this->hash . $this->merchant_id . $this->input["order_number"] . $this->input["total"])) == $this->input["key"] && $this->input["demo"] == "Y";
			
			// Log 
			if (!$retval)
			{
				$this->Log("Error while proccessing TwoCheckout payment");
				$this->Log($this->input);
			}
			
			return $retval;
		}
		
	}
?>